#!/bin/bash
echo `(seq 32)` >txt1
red=(`(seq 32)`)
blue=(`(seq 16)`)
read -p "欢迎购买双色球，请按任意键下单购买一注号码:" anykey
echo -e "\e[031m红球`echo ${red[@]}`\e[0m"
echo -e "\e[034m蓝球`echo ${blue[@]}`\e[0m"
for i in `(seq 6)`
do
        rest_red=($(cat txt1))
        foot=`echo $((RANDOM%(32-i)))`
        echo ${rest_red[$foot]} >>red.txt
        unset rest_red[$foot]
        echo ${rest_red[@]} >txt1
done
        red_ball=($(cat red.txt))
        echo -e "\e[032m你的幸运号码是：**********\e[0m\e[031m红球:`echo ${red_ball[@]}`\e[0m\e[034m 蓝球:`echo $((RANDOM%16+1))`\e[0m\e[032m***********\e[0m"
>red.txt
